<!doctype html>
<html lang="en">
 <head> 
  <meta charset="UTF-8"> 
  <meta name="description" content="燎火的个人博客"> 
  <meta name="keyword" content="燎火,qq799378666,软件开发,java,c#,js,html,html5,css"> 
  <title>Linux服务器安装Oracle服务端总结</title> 
  <script src="/js/jquery-1.11.1.min.js"></script> 
  <script src="/js/bootstrap-3.3.5/js/bootstrap.js"></script> 
  <link href="/js/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet"> 
  <script src="/js/base.js"></script> 
  <script src="/js/nav.js"></script> 
  <script src="/js/jquery.toTop.min.js"></script> 
  <link href="/style/article.css" rel="stylesheet"> 
 </head> 
 <body> 
  <div id="main"> 
   <h3 id="title">Linux服务器安装Oracle服务端总结</h3> 
   <div id="content">
    <p>摘要: 通过ssh远程连接linux服务器，上传Oracle11g的安装包，在无图形化界面的情况，安装Oracle服务器端。本例中linux服务器系统为CentOS6.5.</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">#环境设置</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;"><strong style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">1、检查服务器硬件资源 Linux系统（x86-64）下的硬件要求：</strong></p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">物理内存：最少1GB</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">交互空间：物理内存为1GB至2GB之间时，交互空间为物理内存的1.5倍；物理内存为2GB至8GB之间时，交互空间为物理内存的1倍；物理内存为8GB以上时，交互空间为物理内存的0.75倍。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px; text-align: center;"><img src="http://pic002.cnblogs.com/images/2012/370046/2012102415164048.jpg"></p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">磁盘空间：企业版4.35GB；标准版3.22GB；自定义（最大值）：3.45GB</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;"><strong style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">2、检查内存情况：</strong></p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;"># grep MemTotal /proc/meminfo</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;"># grep SwapTotal /proc/meminfo</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h1 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 24px; font-weight: 500;">1.&nbsp;&nbsp;&nbsp; 为服务器准备好Oracle安装包</h1>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">下载地址：<a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; border: none; outline: 0px; transition: color 0.3s; text-decoration: none; color: rgb(68, 102, 187);">Oracle官方下载地址</a></p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">下载linux x86-64版本，一共两个.zip文件。（Oracle的下载链接，点击之后会跳转到登录界面，登录Oracle账号之后才可以下载，所以不能把下载链接复制到命令行中用wget命令下载，那样下载下来的压缩包是损坏的）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">下载好了连个压缩包以后，我们使用scp远程传输命令将文件传输到服务器端。（这里需要你本机也是linux系统才可以实现，也可以将文件拷入linux虚拟机，使用虚拟机发送过去。）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">scp -P 8022 /home/oracle_linux_1.zip root@222.204.6.82:/home/oracle_linux_1.zip</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">具体命令如上所示，-P一定要大写，8022即为ssh的端口第一个地址表示你本机的zip文件地址，第二个地址表示你要放到服务器的位置。（详情请查看该网址：<a href="https://www.vpser.net/manage/scp.html" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; border: none; outline: 0px; transition: color 0.3s; text-decoration: none; color: rgb(68, 102, 187);">ssh远程传输文件</a>）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">文件传输到linux服务器上以后，就要进入通过ssh命令进入linux服务器的命令行进行操作了。(此处一定要用root用户登录)</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">ssh -p 8022 root@ip</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">进入刚刚传入.zip文件的位置，使用unzip指令解压两个文件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">unzip oracle_linux_1.zip</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">unzip oracle_linux_2.zip</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">两个压缩包会解压到同一个目录下，解压完后，生成一个新目录/database，到这里就把安装包的准备工作做完了。</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h1 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 24px; font-weight: 500;">2.&nbsp;&nbsp;&nbsp; 安装Oracle服务器端软件的步骤</h1>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">原帖：<a href="http://www.linuxidc.com/Linux/2016-12/138483.htm" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; border: none; outline: 0px; transition: color 0.3s; text-decoration: none; color: rgb(68, 102, 187);">CentOS 6.5 64位静默安装Oracle11g</a></p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 安装必要的依赖</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">直接讲下面这句话复制到命令行中，包含了所有依赖</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC unixODBC-devel</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 添加Oracle用户信息</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">#创建oinstall、dba组，将oracle用户加入组，最后一步设定oracle用户的密码。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">groupadd oinstall</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">groupadd dba</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">useradd -g oinstall -G dba oracle</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">passwd oracle</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 修改内核参数</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##编辑文件/etc/sysctl.conf，使用linux的vi编辑器</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">vi /etc/sysctl.conf</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##在该配置文件中修改以下参数，如果不存在的就是直接添加，如果默认值比参考值大的话，就不需要修改。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">fs.aio-max-nr = 1048576</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">fs.file-max = 6815744</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">kernel.shmall = 2097152</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">kernel.shmmax = 536870912</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">kernel.shmmni = 4096</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">kernel.sem = 250 32000 100 128</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">net.ipv4.ip_local_port_range = 9000 65500</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">net.core.rmem_default = 262144</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">net.core.rmem_max = 4194304</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">net.core.wmem_default = 262144</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">net.core.wmem_max = 1048586</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##编辑完后保存，执行以下命令使其生效</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">sysctl -p</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 修改用户资源限制</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##1、修改/etc/security/limits.conf配置文件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">vi /etc/security/limits.conf</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##配置文件的最下方加入以下参数</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; soft&nbsp;&nbsp;&nbsp; nproc&nbsp; 2047</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard&nbsp;&nbsp;&nbsp; nproc&nbsp; 16384</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; soft&nbsp;&nbsp;&nbsp; nofile&nbsp; 1024</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard&nbsp;&nbsp;&nbsp; nofile&nbsp; 65536</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; soft&nbsp;&nbsp;&nbsp; stack&nbsp;&nbsp; 10240</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##保存并退出</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##2、修改/etc/pam.d/login配置文件，</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">vi /etc/pam.d/login</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##在配置文件中加入</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">session required /lib/security/pam_limits.so</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">session required pam_limits.so</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 创建安装目录</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">创建安装目录/usr/local/oracle&nbsp;&nbsp; /usr/local/oraInventory&nbsp; /usr/local/oradata，并赋予用户组权限。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">mkdir -p /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">chown -R oracle:oinstall /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">chmod -R 775 /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 创建oraInst.loc文件</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##创建/etc/oraInst.loc文件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　vi /etc/oraInst.loc</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##文件内加入以下内容</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　inventory_loc=/usr/local/oraInventory</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　inst_group=oinstall</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##保存退出后执行以下命令。设定该文件的用户组及权限。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　chown oracle:oinstall /etc/oraInst.loc</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　chmod 664 /etc/oraInst.loc</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 准备oracle安装应答模板文件db_install.rsp文件</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 1、该文件默认存放在解压后的安装包内，也就是本例中/home/database/response下，</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##　　 将oracle静默安装所需应答文件全部拷贝至 /usr/local/oracle文件夹下</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">cp /home/database/response/* /usr/local/oracle/</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 2、修改安装所需的所有应答文件的所属组及权限</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">chown&nbsp; oracle:oinstall /usr/local/oracle*.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">chmod 755 /usr/local/oracle/*.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 3、配置db_install.rsp文件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">vi /usr/local/oracle/db_install.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 4、文件内修改相应的参数配置如下：</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.option=INSTALL_DB_SWONLY&nbsp;&nbsp;&nbsp;&nbsp; 　//安装类型,只装数据库软件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">ORACLE_HOSTNAME=serv2.lin.vm.ncu &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//主机名称（在命令行输入hostname查询）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">UNIX_GROUP_NAME=oinstall&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　　// 安装组</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">INVENTORY_LOCATION=/usr/local/oraInventory&nbsp; 　//INVENTORY目录（**不填就是默认值,本例此处需修改,因个人创建安装目录而定）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">SELECTED_LANGUAGES=en,zh_CN&nbsp;&nbsp;&nbsp; 　　 　　// 选择语言</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">ORACLE_HOME=/usr/local/oracle/product/11.2.0/db_1&nbsp; 　// oracle_home *路径根据目录情况注意修改 本例安装路径/usr/local/oracle</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">ORACLE_BASE=/usr/local/oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // oracle_base *注意修改</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.InstallEdition=EE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　// oracle版本</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.isCustomInstall=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　//自定义安装，否，使用默认组件</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.DBA_GROUP=dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　　 //dba用户组</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.OPER_GROUP=oinstall&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　 //oper用户组</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.config.starterdb.type=GENERAL_PURPOSE&nbsp;&nbsp; //数据库类型</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.config.starterdb.globalDBName=orcl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //globalDBName</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.config.starterdb.SID=orcl&nbsp; 　　　　 //SID（**此处注意与环境变量内配置SID一致）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.config.starterdb.memoryLimit=81920&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //自动管理内存的内存(M)</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">oracle.install.db.config.starterdb.password.ALL=oracle&nbsp;&nbsp;&nbsp; //设定所有数据库用户使用同一个密码</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">SECURITY_UPDATES_VIA_MYORACLESUPPORT=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　//（手动写了false）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">DECLINE_SECURITY_UPDATES=true　　　　　　　　　　// **注意此参数 设定一定要为true</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 设置oracle用户环境</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 由root切换至创建好的oracle用户</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　su – oracle</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 修改该用户的用户配置文件，该文件就在~目录下，可以先执行cd 或者cd ~</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　vi .bash_profile</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 文件内加入并修改至以下内容</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　export ORACLE_BASE=/usr/local/oracle</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　export ORACLE_SID=orcl&nbsp;&nbsp;&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　export ORACLE_OWNER=oracle</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 保存退出后执行source命令立即生效。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">source .bash_profile</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在oracle用户下开始安装</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">## 执行命令。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">/home/oracle/database/./runInstaller -silent -force -ignorePrereq -responseFile /usr/local/oracle/db_install.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">##参数说明&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　/home/database 是安装包解压后的路径，此处根据安装包解压所在位置做修改，因人而异。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　runInstaller 是主要安装脚本</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　-silent 静默模式</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　-force 强制安装</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　-ignorePrereq忽略warning直接安装。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　-responseFile读取安装应答文件。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">2.10&nbsp;&nbsp; 运行脚本</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">执行完安装指令后，在原来那个窗口（1号窗口）可以什么事情都不做，重开一个命令行窗口（2号窗口），以root身份登录到服务器。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">在2号窗口进入/usr/local/oracle/product/11.2.0/db_1目录，可以看到安装数据库已经装在这个目录下了，并且有一个root.sh文件在这个目录下。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">这个时候等1号窗口出现以下提示，安装编译需要一定的时间，请耐心等待。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">#-------------------------------------------------------------------</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　/usr/oracle/oraInventory/orainstRoot.sh（这一句可能没有。。具体原因我也不清楚，不影响安装，如果有这一句，也要运行这个orainstRoot.sh脚本）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　/usr/oracle/product/11.2.0/db_1/root.sh</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　To execute the configuration scripts:</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　1. Open a terminal window</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　2. Log in as "root"</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　3. Run the scripts</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">　　4. Return to this window and hit"Enter" key to continue</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;　　Successfully Setup Software.</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">#------------------</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">出现以上界面后，到2号窗口运行root.sh脚本</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">./root.sh</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">数据库安装过程到这里结束，下面是配置。</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h1 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 24px; font-weight: 500;">3.&nbsp;&nbsp;&nbsp; 数据库的配置和创建</h1>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">3.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 创建数据库</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">这里切换成</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">进入/usr/local/oracle目录，编辑dbca.rsp创建数据库应答文件：</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">vi dbca.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">修改几个参数，如果这几个参数被注释了，要取消注释（<strong style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; color: rgb(255, 0, 0);">这个文件一定要修改，否则会造成数据库创建后无法挂载</span></strong>）</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">GDBNAME = “orcl”</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">SID = “orcl”</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">CHARACTERSET = “ZHS16GBK”</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">NATIONALCHARACTERSET= “AL16UTF16”</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">SOURCEDB = “serv2.lin.vm.ncu:1521:orcl”</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">保存退出后，执行dbca指令创建数据库：</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">dbca -silent -responseFile dbca.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">出现以下界面</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">Copying database files</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">1% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">3% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">11% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">18% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">26% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">37% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">Creating and starting Oracle instance</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">40% complete</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">…………………………</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">执行到100%后，数据库创建完成</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">&nbsp;</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h2 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 22px; font-weight: 500;">3.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 开启数据库网络监听</h2>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">还在刚才的目录下，有一个netca.rsp文件,执行以下命令</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">netca -silent -responseFile netca.rsp</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;"><strong style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">开启监听</strong></p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">lsnrctl start</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">dbstart $ORACLE_HOME</p>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h1 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 24px; font-weight: 500;">&nbsp;</h1>
    <p><span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;"></span></p>
    <h1 style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: 24px; font-weight: 500;"><strong style="box-sizing: inherit; -webkit-tap-highlight-color: transparent;">--后记--</strong></h1>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">详细的安装步骤是同在实验室的傅老大同学根据安装过程总结出来的。对于其中遇到的一些报错问题有详细的解决方案。感谢傅老大~！</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">经过进一步的了解对比，对于这种 Linux 服务器上的DB服务，直接使用docker镜像启动会更简单一些，不用每次安装那么麻烦。</p>
    <p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; margin-bottom: 16px;">不过，针对docker容器引擎还需要进一步深入研究。这是下一步的学习目标。</p>
    <p><br></p>
   </div> 
  </div>  
 </body>
</html>